import Vue from 'vue'// 引入vue

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'// 引入element ui
import 'element-ui/lib/theme-chalk/index.css'// 引入element ui 的样式
// import locale from 'element-ui/lib/locale/lang/en' // 国际化 语言进行切换

import '@/styles/index.scss' // global css //全局的公共样式
import App from './App' // 根组件
import store from './store'// vuex
import router from './router'// 路由

import '@/icons' // icon
import '@/permission' // 权限控制
import * as filters from '@/filter'

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

// 引入打印第三方包
import Print from 'vue-print-nb'
Vue.use(Print)

// 引入自己的全局函数
import ZgUI from '@/components'
Vue.use(ZgUI)

// 自定义过滤器
console.log(filters)
Object.keys(filters).forEach(item => {
  Vue.filter(item, filters[item])
})

Vue.config.productionTip = false// 关闭生产阶段的警告提示

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
